package com.flymobi.fw.dao;

import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.interceptor.TransactionInterceptor;

/**
 * 
 * 
 * Title:
 * 
 * Description:
 * 
 * Copyright: Copyright (c) 2008
 * 
 * @author haoxz11
 * @created Mar 7, 2008 11:53:41 AM
 * @version $Id: TransactionSupport.java,v 1.1 2008/03/26 06:24:09 airsou Exp $
 */
public class TransactionSupport {

    /**
     * 
     */
    public static void rollback() {
        TransactionStatus status = TransactionInterceptor
                .currentTransactionStatus();
        if (null == status) {
            throw new IllegalStateException(
                    "Rollback must be called in transaction context.");
        }
        status.setRollbackOnly();
    }
}
